package com.wj.chatroom.mapper;

import com.wj.chatroom.model.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
   @Options(useGeneratedKeys = true,keyProperty = "userId")
   @Insert("insert into user values(null,#{username},#{password})")
   Integer insert(User user);
   @Select("select * from user where username = #{username}")
   User selectByName(String username);
}